{
  "properties" : { },
  "id" : "a9255c004b3d4c928976e4e030014312",
  "script" : null,
  "groupId" : "2c92eacbda69445da33bd47eb1e59b2d",
  "name" : "导出Excel示例",
  "createTime" : null,
  "updateTime" : 1651140595331,
  "lock" : null,
  "createBy" : null,
  "updateBy" : "admin",
  "path" : "/excel",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import lombok.experimental.var
import mongoTemplete;
import org.apache.commons.collections.CollectionUtils;
import response;
import request;

var title = [
    {"title":"报备人员","width":4000},
    {"title":"性别","width":4000},
    {"title":"年龄","width":4000},
    {"title":"联系方式","width":4000},
    {"title":"身份证号码","width":6000},
    {"title":"抗原检测结果","width":4000},
    {"title":"现住址(街道+具体地址)","width":6000},
    {"title":"年月日","width":6000},
    {"title":"年月日时分秒","width":10000}
]

var fieldName = [
    {"fieldName":"name"},
    {"fieldName":"sex"},
    {"fieldName":"age","type":"Integer"},
    {"fieldName":"mobile"},
    {"fieldName":"cardNo"},
    {"fieldName":"result"},
    {"fieldName":"address"},
    {"fieldName":"startTime","type":"Date","format":"yyyy年MM月dd日"},
    {"fieldName":"endTime","type":"Date","format":"yyyy年MM月dd日 HH时mm分ss秒"}
]

var list = [{
    "name":"张三",
    "sex":"男",
    "age":18,
    "mobile":"13900009999",
    "cardNo":"510105199909090009",
    "result":"阳性",
    "address":"古城社区9527号",
    "startTime":new Date(),
    "endTime":new Date()
}]

mongoTemplete.exportExcel(request,response,list,"示例.xls",title,fieldName);